package com._2048;

import java.awt.Color;
import java.awt.Rectangle;
import java.util.ResourceBundle;

// 常量
class Const {
    // 格
    public static final int GRID_SIZE = 120;                                                    // 宽度

    // 游戏区域
    public static final int GAME_BOARD_X = 10;                                                  // 左上角 X 坐标
    public static final int GAME_BOARD_Y = 10;                                                  // 左上角 Y 坐标
    public static final int GAME_BOARD_GRID_COUNT_H = 4;                                        // 横向格数
    public static final int GAME_BOARD_GRID_COUNT_V = 4;                                        // 纵向格数
    public static final int GAME_BOARD_WIDTH = GRID_SIZE * GAME_BOARD_GRID_COUNT_H;             // 宽度
    public static final int GAME_BOARD_HEIGHT = GRID_SIZE * GAME_BOARD_GRID_COUNT_V;            // 高度
    public static final Color GAME_BOARD_COLOR = new Color(250, 200, 150);                      // 背景色
    public static final String GAME_BOARD_FONT_NAME = "Arial";                                  // 字体名
    public static final int GAME_BOARD_FONT_SIZE = 48;                                          // 字体尺寸
    
    // 胜利数
    public static final int WIN_NUMBER = 2048;                                                  // 达到此数胜利
    
    // 主窗口
    public static final int WIDTH = 506;                                                        // 宽度
    public static final int HEIGHT = 582;                                                       // 高度

    // 控件
    public static final Rectangle BUTTON_START_BOUNDS = new Rectangle(10, 502, 481, 40);        // "开始"按钮位置、尺寸

    // 字符串
    private static final ResourceBundle RESOURCE = ResourceBundle.getBundle("language_zh_CN");  // 资源

    /**
     * 获取字符串。
     * @param id   字符串 id
     * @return 字符串
     */
    public static String getString(String id) {
        return RESOURCE.getString(id);
    }
}
